<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title>碧城</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<META HTTP-EQUIV="pragma" CONTENT="no-cache"> 
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate"> 
<META HTTP-EQUIV="expires" CONTENT="0">
<link href="css/index.css" type="text/css" rel="stylesheet">
<link href="css/foot.css" type="text/css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet" type="text/css">
<link href="css/tuangou.css" rel="stylesheet" type="text/css">
<link href="css/order.css" rel="stylesheet" type="text/css">
<link href="css/vip.css" rel="stylesheet" type="text/css">
<link href="css/head.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="js/request.js"></script>
<script type="text/javascript">
//按商品品牌展示
function listBrandItem(brandId){
	var categoryId='${category.item_clsno}';
	window.location.href="listItem.htm?categoryId="+categoryId+"&brandId="+brandId;
}
//跳转到指定页次
function gotoPage(pageCount){
	var categoryId='${category.item_clsno}';
	var brandId="";
	var pageSize=${pageSize};
	<#if brand?exists>
	brandId='${(brand?if_exists).brand_no}';
	</#if>
	var sort='${sort}';
	var sortSeq='${sortSeq}';
	var layout='${layout}';
	var queryStr="categoryId="+categoryId;
	if(brandId!=null&&brandId!=""){
		queryStr=queryStr+"&brandId="+brandId;
	}
	queryStr=queryStr+"&pageCount="+pageCount;
	queryStr=queryStr+"&pageSize="+pageSize;
	queryStr=queryStr+"&layout="+layout+"&sort="+sort+"&sortSeq="+sortSeq;
	//alert("listItem.htm?"+queryStr);
	window.location.href="listItem.htm?"+queryStr;
}

//选择新的页面版式
function listByNewLayout(layout){
	var categoryId='${category.item_clsno}';
	var brandId="";
	var pageSize=${pageSize};
	var pageCount=${pageCount};
	<#if brand?exists>
	brandId='${(brand?if_exists).brand_no}';
	</#if>
	var sort='${sort}';
	var sortSeq='${sortSeq}';
	var queryStr="categoryId="+categoryId;
	if(brandId!=null&&brandId!=""){
		queryStr=queryStr+"&brandId="+brandId;
	}
	queryStr=queryStr+"&pageCount="+pageCount;
	queryStr=queryStr+"&pageSize="+pageSize;
	queryStr=queryStr+"&layout="+layout+"&sort="+sort+"&sortSeq="+sortSeq;
	window.location.href="listItem.htm?"+queryStr;
}

//选择新的排序方式
function listByNewSort(obj){
	
	var categoryId='${category.item_clsno}';
	var brandId="";
	<#if brand?exists>
	brandId='${(brand?if_exists).brand_no}';
	</#if>
	var layout='${layout}';
	var option=obj.options[obj.selectedIndex];
	var op_values=option.value.split(",");
	var sort=op_values[0];
	var sortSeq=op_values[1];
	var queryStr="categoryId="+categoryId;
	if(brandId!=null&&brandId!=""){
		queryStr=queryStr+"&brandId="+brandId;
	}
	queryStr=queryStr+"&layout="+layout+"&sort="+sort+"&sortSeq="+sortSeq;
	window.location.href="listItem.htm?"+queryStr;
}
//下一页
function gotoNext(){
	var totalPageNum=${totalPageNum};
	var pageCount=${pageCount};
	if(pageCount==totalPageNum){
		alert("当前已是最后一页");
		return;
	}
	gotoPage(pageCount+1);
}

function gotoPre(){
	var pageCount=${pageCount};
	if(pageCount==1){
		alert("当前已是第一页");
		return;
	}
	gotoPage(pageCount-1);
}
//Enter按下跳转到指定页面
function go(obj,event){
	var keynum
	
	if(window.event) // IE
	{
		keynum = event.keyCode
	}
	else if(event.which) // Netscape/Firefox/Opera
	{
		keynum = event.which
	}
	
	if(keynum!=13)//Enter
		return;
	gotoPage(obj.value);
}
//刷新当前页面
function reloadPage(){
	window.location.reload();
}
//增加到商品购物车并刷新当前页面
function addToCart(itemId,useshape){
	var qty=document.getElementById("qty"+itemId).value;
	var shape=null;
	if(useshape==true){
		var shapeSelect=document.getElementById("shape"+itemId);
		shape=shapeSelect.options[shapeSelect.selectedIndex].value;
	}
	else{
		shape=2;
	}
	var url="addCart.do?itemId="+itemId+"&shape="+shape+"&qty="+qty;
	request(url,reloadPage);
}

//收藏
var http_request=null;
function addCollection(itemId){
	http_request=getRequest();
	if (http_request == null) {
		alert("Your browser does not support AJAX!");
		return;
	}
	http_request.onreadystatechange = showMessage;
	http_request.open("GET", "addCollection.do?itemId="+itemId, true);
	http_request.send(null);
}

function showMessage(){
	if (http_request.readyState == 4) {
		alert(http_request.responseText);
	}
}

</script>
</head>
<body>
<#------------------ include header -------------------------------->
<#include "/WEB-INF/view/header.ftl" />
<#------------------ include header -------------------------------->
<div class="head_outer4"> 您现在的位置是: <a href="index.htm">首页</a> <#list ancestries?if_exists as cateogry>  》<#if (cateogry.item_clsno?length>2) > <a href='listItem.htm?categoryId=${cateogry.item_clsno}'>${cateogry.item_clsname}</a><#else> ${cateogry.item_clsname}</#if>  </#list>   》   <a href='listItem.htm?categoryId=${category.item_clsno}'>${category.item_clsname}</a> <#if brand?exists>  》   ${brand.brand_name}</#if> </div>
<div class="share_body">
  <div class="share_left">
    <!-- 商品分类 -->
    <table class="shareleft01" border="0" cellpadding="0" cellspacing="0">
      <tbody>
        <tr>
          <td class="index_cat01">商品分类</td>
        </tr>
        <tr>
          <td class="index_cat02" valign="top" align="center"><P> <#list list as categoryList>
            <table class="left_table" width="94%" border="0" cellpadding="0" cellspacing="0">
              <tbody>
                <tr>
                  <td align="left"><span class="left_title">${categoryList[0].item_clsname}</span></td>
                </tr>
                <tr>
                  <td><#list categoryList[1] as childCategory>
                    <#if (childCategory_index+1)%3 = 0> <a href= "listItem.htm?categoryId=${childCategory.item_clsno}">${childCategory.item_clsname}</a></td>
                </tr>
                <tr>
                  <td><#else> <a href= "listItem.htm?categoryId=${childCategory.item_clsno}">${childCategory.item_clsname}</a>|
                    </#if>
                    </#list>
              </tbody>
            </table>
            </#list>
            </P>
          </td>
        </tr>
        <tr>
          <td background="img/index_02.gif" height="7"></td>
        </tr>
      </tbody>
    </table>
    <table class="shareleft02" border="0" cellpadding="0" cellspacing="0">
      <tbody>
        <tr>
          <td class="index_cat01">本类热卖推荐</td>
        </tr>
        <tr>
          <td class="index_cat02"><table width="110" border="0" cellpadding="0" cellspacing="0">
              <tbody>
                <tr>
                  <td class="td7" align="center" height="110"></td>
                </tr>
              </tbody>
            </table></td>
        </tr>
        <tr>
          <td background="img/index_02.gif" height="7"></td>
        </tr>
      </tbody>
    </table>
    <table class="shareleft02" width="100%" border="0" cellpadding="0" cellspacing="0">
      <tbody>
        <tr>
          <td class="index_cat01">热卖排行</td>
        </tr>
        <tr>
          <td class="index_cat02"><table style="margin: 3px; background-color: rgb(255, 255, 255);" width="96%" border="0" cellpadding="0" cellspacing="0">
              <tbody>
                <tr>
                  <td colspan="2" height="5"></td>
                </tr>
                <#list rankItem?if_exists as item>
                <tr>
                  <td valign="middle" width="20" align="center"><img src="img/sq_01.gif"></td>
                  <td width="153" align="left"><a href="item_${item.item_no}.htm" target="_blank" title="${item.titles}"> ${item.titles}</a> </td>
                </tr>
				</#list>
              </tbody>
            </table></td>
        </tr>
        <tr>
          <td background="img/index_02.gif" height="7"></td>
        </tr>
      </tbody>
    </table>
    <table class="shareleft02" width="100%" border="0" cellpadding="0" cellspacing="0">
      <tbody>
        <tr>
          <td class="index_cat01">近期浏览</td>
        </tr>
        <tr>
          <td class="index_cat02"><table style="margin: 3px; background-color: rgb(255, 255, 255);" width="96%" border="0" cellpadding="0" cellspacing="0">
            <tbody>
              <tr>
                <td colspan="2" height="5"></td>
              </tr>
              <#list history as item>
              <tr>
                <td valign="middle" width="20" align="center"><img src="img/sq_01.gif"></td>
                <td width="153" align="left"><a href="item_${item.item_no}.htm" target="_blank" title=" ${item.titles}"> ${item.titles}</a> </td>
              </tr>
              </#list>
            </tbody>
          </table>
          <table class="table3" width="90%" border="0" cellpadding="0" cellspacing="0">
              <tbody>
                <tr> </tr>
              </tbody>
            </table></td>
        </tr>
        <tr>
          <td background="img/index_02.gif" height="7"></td>
        </tr>
      </tbody>
    </table>
  </div>
  <div class="share_right">
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tbody>
        <tr>
          <td class="pli_table4" width="88%">按分类选择</td>
        </tr>
      </tbody>
    </table>
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tbody>
        <tr>
          <td class="share_flash_topleft"></td>
          <td class="share_flash_topmidst"></td>
          <td class="share_flash_topright"></td>
        </tr>
        <tr>
          <td class="share_flash_midstleft"></td>
          <td class="share_flash_midstmidst"><table class="fenleitable" width="99%">
              <tbody>
                <tr height="23"> <#list categories as category>
                  <td width="16%" align="left">· <a href="listItem.htm?categoryId=${category.item_clsno}">${category.item_clsname}</a></td>
                  <#if (category_index+1)%5=0> </tr>
                <tr> </#if>
                  </#list> </tr>
              </tbody>
            </table></td>
          <td class="share_flash_midstright"></td>
        </tr>
        <tr>
          <td class="share_flash_bottomleft"></td>
          <td class="share_flash_bottommidst"></td>
          <td class="share_flash_bottomright"></td>
        </tr>
      </tbody>
    </table>
    <table class="table3" width="100%" border="0" cellpadding="0" cellspacing="0">
      <tbody>
        <tr>
          <td class="pli_table4" width="88%">按品牌选择</td>
          <td width="12%"><!--更多品牌--></td>
        </tr>
      </tbody>
    </table>
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tbody>
        <tr>
          <td class="share_flash_topleft"></td>
          <td class="share_flash_topmidst"></td>
          <td class="share_flash_topright"></td>
        </tr>
        <tr>
          <td class="share_flash_midstleft"></td>
          <td class="share_flash_midstmidst" width="779"><table class="fenleitable" width="99%">
              <tbody>
                <tr height="23"> <#list brands as brand>
                  <td width="16%" align="left">· <a href="#" onClick="listBrandItem('${brand.brand_no}')">${brand.brand_name}</a></td>
                  <#if (brand_index+1)%5=0> </tr>
                <tr> </#if>
                  </#list> </tr>
              </tbody>
            </table></td>
          <td class="share_flash_midstright"></td>
        </tr>
        <tr>
          <td class="share_flash_bottomleft"></td>
          <td class="share_flash_bottommidst"></td>
          <td class="share_flash_bottomright"></td>
        </tr>
      </tbody>
    </table>
    <div class="share_fenye">
      <div class="share_fenye_left"></div>
      <div class="share_fenye_midst">
        <div class="share_fenye_content">共${totalNum}条&nbsp;&nbsp;   &nbsp;&nbsp; <a href="#" onClick="gotoPre()">上一页</a> <#assign before=0>
          <#assign after=0>
          <#list 1..totalPageNum as i>
          <#if ((i<3)||((totalPageNum-i)<3)||((pageCount-i)<3&&(pageCount-i)>-3))> <a href="#" onClick="gotoPage(${i})"> <#if pageCount==i> <span class="share_fenyeword">${i}</span> <#else>
          ${i}
          </#if> </a> <#else>
          <#if ((i-pageCount)<0)>
          <#if (before==0)>
          ...
          <#assign before=1>      				
          </#if>
          <#else>
          <#if (after==0)>
          ...
          <#assign after=1>      				
          </#if>
          </#if>
          </#if>
          </#list> <a href="#" onClick="gotoNext()">下一页</a> 到第
          <input name="pagenum" class="plist_input2" value="${pageCount}" type="text" width="5" onKeyDown="go(this,event)">
          页</div>
        <div class="share_fenye_pailie">排列方式： <a href="javascript:listByNewLayout('table')">列表</a> | <a href="javascript:listByNewLayout('pic')">图片</a> | <a href="javascript:listByNewLayout('text')">文字</a></div>
        <div class="share_fenye_paixu">排序： </div>
        <div class="share_fenye_paixu2">
          <select onChange="listByNewSort(this)">
            <option value="price,1" <#if sort=="price"&&sortSeq==1>selected="selected"</#if>>商品价格↓</option>
            <option value="price,0" <#if sort=="price"&&sortSeq==0>selected="selected"</#if>>商品价格↑</option>
            <option value="default,1" <#if sort=="default">selected="selected"</#if>>碧家推荐</option>
          </select>
        </div>
      </div>
      <div class="share_fenye_right"></div>
    </div>
    <table class="pro_search" width="100%" border="0" cellpadding="0" cellspacing="0">
      <tbody>
        <#list items?if_exists as item>
        <tr>
          <td valign="middle" width="4%" align="center">
         
         </td>
          <td valign="middle" width="19%" align="center" height="120"><table class="pli_table3" width="110" border="0" cellpadding="0" cellspacing="0" height="110">
              <tbody>
                <tr>
                  <td valign="middle" align="center"><a href="item_${item.item_no}.htm" target="_self"><img src="http://image.b2office.com.cn/goods/middle/${item.item_no}.jpg" title="${item.titles}" width="110" border="0" height="110"></a></td>
                </tr>
              </tbody>
          </table></td>
          <td valign="top" width="45%" align="center"><table width="97%" border="0" cellpadding="0" cellspacing="0">
              <tbody>
                <tr>
                  <td colspan="2" class="plist_title2" align="left">${item.titles}</td>
                </tr>
                <tr>
                  <td width="40%" align="left">碧家价：
                  <#if item.usenewunit==1>
                    <#if item.useshape==1>
                    ￥${item.b2hprice}元/${item.unit_no}
                    <#else>
                    ￥${item.b2hprice*item.midqty}元/${item.newunit}
                    </#if>
                    <#else>
                    ￥${item.b2hprice}元/${item.unit_no}
                    </#if>
                  </td>
                </tr>
                <tr>
                  <td width="40%" align="left">数量:
                     <input id="qty${item.item_no}" name="qty${item.item_no}" value="1" class="plist_input2_2" type="text" <#if item.inventstate==1>disabled</#if>>
                    <#if item.usenewunit==1>
                    <#if item.useshape==1>
                    <select name="shape${item.item_no}" id="shape${item.item_no}">
                      <option value="3">大${item.newunit} 约${item.bigqty}${item.unit_no}</option>
                      <option value="2" selected>中${item.newunit} 约${item.midqty}${item.unit_no}</option>
                      <option value="1">小${item.newunit} 约${item.smlqty}${item.unit_no}</option>
                    </select>
                    <#else>
                    ${item.newunit}
                    </#if>
                    <#else>
                    ${item.unit_no}
                    </#if> 
                  </td>
                </tr>
                <tr>
                  <td width="20%" align="left">配送周期：${item.deliverday}小时</td>
                </tr>
              </tbody>
          </table></td>
          <td valign="middle" width="32%" align="center"><table width="90%" border="0" cellpadding="0" cellspacing="0" height="60">
              <tbody>
                <tr>
                 <td align="left">
                 <#if item.inventstate==0>
	              <a href="javascript:addToCart(${item.item_no},<#if (item.usenewunit==1)&&(item.useshape==1)>true<#else>false</#if>)"><img src="img/plist_06.gif" width="67" border="0" height="21"></a>
	              <#else>
	              <img src="img/plist_06_2.gif" width="67" border="0" height="21">
	              </#if>
                 </td>
                 <td align="center"><a href="javascript:addCollection('${item.item_no}')"><img src="img/plist_07.gif" width="67" border="0" height="21"></a></td>
                </tr>
              </tbody>
          </table></td>
        </tr>
        <tr>
          <td colspan="4" valign="middle" height="8"><table class="share_fengxian_outer" border="0" cellpadding="0" cellspacing="0">
              <tbody>
                <tr>
                  <td class="share_fengexian"></td>
                </tr>
              </tbody>
            </table></td>
        </tr>
        </#list>
      </tbody>
    </table>
    <div class="share_fenye">
      <div class="share_fenye_left"></div>
      <div class="share_fenye_midst">
        <div class="share_fenye_content">共${totalNum}条&nbsp;&nbsp;   &nbsp;&nbsp; <a href="#" onClick="gotoPre()">上一页</a> <#assign before=0>
          <#assign after=0>
          <#list 1..totalPageNum as i>
          <#if ((i<3)||((totalPageNum-i)<3)||((pageCount-i)<3&&(pageCount-i)>-3))> <a href="#" onClick="gotoPage(${i})"> <#if pageCount==i> <span class="share_fenyeword">${i}</span> <#else>
          ${i}
          </#if> </a> <#else>
          <#if ((i-pageCount)<0)>
          <#if (before==0)>
          ...
          <#assign before=1>      				
          </#if>
          <#else>
          <#if (after==0)>
          ...
          <#assign after=1>      				
          </#if>
          </#if>
          </#if>
          </#list> <a href="#" onClick="gotoNext()">下一页</a> 到第
          <input name="pagenum2" class="plist_input2" value="${pageCount}" type="text" width="5" onKeyDown="go(this,event)">
          页</div>
        
        <div class="share_fenye_pailie">排列方式： <a href="javascript:listByNewLayout('table')">列表</a> | <a href="javascript:listByNewLayout('pic')">图片</a> | <a href="javascript:listByNewLayout('text')">文字</a></div>
        <div class="share_fenye_paixu">排序： </div>
        <div class="share_fenye_paixu2">
          <select onChange="listByNewSort(this)">
            <option value="price,1" <#if sort=="price"&&sortSeq==1>selected="selected"</#if>>商品价格↓</option>
            <option value="price,0" <#if sort=="price"&&sortSeq==0>selected="selected"</#if>>商品价格↑</option>
            <option value="default,1" <#if sort=="default">selected="selected"</#if>>碧家推荐</option>
          </select>
        </div>
      </div>
      <div class="share_fenye_right"></div>
    </div>
  </div>
</div>
<div class="foot_outer1">
  <div class="foot02"></div>
  <div class="foot02"></div>
  <div class="foot02"></div>
  <div class="foot02"></div>
  <div class="foot03"></div>
</div>
<#------------------------------ include file  -------------------------------------------->
<#include "/WEB-INF/view/footer.ftl" />
<#------------------------------  include file  ------------------------------------------>
</body>
</html>
